﻿<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head lang="en" id="public_head">
    <meta charset="UTF-8">
    <title>血库管理系统 之 医生管理</title>
    <link rel="stylesheet" th:href="@{/css/public.css}" href="../css/public.css"/>
    <link rel="stylesheet" th:href="@{/css/style.css}" ref="../css/style.css"/>
</head>
<body>
<!--头部-->
<header class="publicHeader" id="public_header">
    <h1>血库管理系统 之 医生管理</h1>
    <div class="publicHeaderR">
        <p><span></span><span style="color: #fff21b"> [[${session.loginUser.d_name}]]</span> , 欢迎你！</p>
        <a th:href="@{/logout}" href="../main/login.html">退出</a>
    </div>
</header>
<!--时间-->
<section class="publicTime" th:replace="main/public :: #public_time">
</section>
<!--主体内容-->
<section class="publicMian ">
    <div class="left" id="public_left">
        <h2 class="leftH2"><span class="span1"></span>功能列表 <span></span></h2>
        <nav>
            <ul class="list">
                <li th:id="${activeUri == 'patient' ? 'active': ''}"><a
                        th:href="@{/doctors/} + ${session.loginUser.d_id} ">个人信息查看</a></li>
                <li th:id="${activeUri == 'patient' ? 'active': ''}"><a
                        th:href="@{/doctorToPatients/} + ${session.loginUser.d_id} ">查看病人信息</a></li>
                <li th:id="${activeUri == 'patient' ? 'active': ''}"><a
                        th:href="@{/doctorApply/} + ${session.loginUser.d_id} ">申请用血</a></li>
                <li th:id="${activeUri == 'pwd' ? 'active': ''}"><a th:href="@{/doctor/pwd}"
                                                                    href="../main/password.html">密码修改</a></li>
                <li><a th:href="@{/logout}" href="../main/login.html">退出系统</a></li>
            </ul>
        </nav>
    </div>
    <div class="right">
        <div class="location">
            <strong>你现在所在的位置是:</strong>
            <span>申请管理页面 >> 申请添加页面</span>
        </div>
        <div class="providerAdd">
            <form id="addForm" th:action="@{/doctorAddUseBloodData}" th:method="post" action="#">
                <div th:if="${not #strings.isEmpty(noPatient)}" th:text="${noPatient}" style="color:red; margin-left: 130px">病人信息不存在!</div>
                <div>
                    <label for="u_d_id">医生工号：</label>
                    <input readonly="readonly" type="text" name="u_d_id" id="u_d_id" th:value="${session.loginUser.d_id}"/>
                    <span>*请查看工号是否正确</span>
                </div>
                <div>
                    <label for="u_bname">患者姓名：</label>
                    <input type="text" name="u_bname" id="u_bname"/>
                    <span>*请输入患者姓名</span>
                </div>
                <div>
                    <label for="u_type">申请类型：</label>
                    <input type="text" name="u_type" id="u_type"/>
                    <span>*请输入申请类型</span>
                </div>
                <div>
                    <label for="u_num">申请数量：</label>
                    <input type="text" name="u_num" id="u_num"/>
                    <span>*请输入申请数量</span>
                </div>
                <div class="providerAddBtn">
                    <input type="button" value="添加" onclick="$('#addForm').submit()"/>
                    <input type="button" value="返回" onclick="history.back(-1)"/>
                </div>
            </form>
        </div>
    </div>
</section>
<footer class="footer" th:replace="main/public :: #public_footer">
</footer>
<script th:src="@{/webjars/jquery/3.3.1/jquery.js}" src="../js/jquery.js"></script>

<!--<script type="text/javascript" th:inline="javascript">
    // 要使用thymeleaf行内表达式则上面需要使用：th:inline="javascript" 标识
    $(function () {

        var isCheck = false;
        //原密码失去焦点
        $("#oldPassword").blur(function () {
            var oldPassword = $(this).val().trim();
            if(!oldPassword) {
                $('#pwdText').css('color', 'red');
                isCheck = false;
                return ;
            }


            //theymeleaf行内表达式
            var url = [[@{/doctor/pwd/}]] + oldPassword;
            //异步判断密码是否正确
            $.ajax({
                url: url,
                dataType: 'json',
                method: 'GET',
                success: function (data) {
                    isCheck = data;
                    data ? $("#pwdText").replaceWith("<span id='pwdText'>*原密码正确</span>")
                        : $("#pwdText").replaceWith("<span id='pwdText' style='color: red'>*原密码错误</span>");
                },
                error: function () {
                    $('#pwdText').html("校验原密码异常");
                    isCheck = false;
                }
            });
        });

        $("#save").click(function () {

            if(isCheck) {
                if($("#newPassword").val() && $("#reNewPassword").val()
                    && $("#newPassword").val() == $("#reNewPassword").val()) {
                    $("#pwdForm").submit();
                }else{
                    $("#reNewPwdText").replaceWith("<span id='reNewPwdText' style='color: red'>*保证和新密码一致</span>");
                }
            }

        });
    });
</script>-->

</body>
</html>